import React, { Component } from 'react';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import Button from '@material-ui/core/Button';
import List from '@material-ui/core/List';
import Divider from '@material-ui/core/Divider';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import InboxIcon from '@material-ui/icons/MoveToInbox';
import MailIcon from '@material-ui/icons/Mail';
import { ChangeSideSubjectApi } from '@/request/api'
import './drawer.less'


export default class MyDrawer extends Component {
  state = {
    // 科目列表
    subList: []
  }
 
  componentDidMount() {
    ChangeSideSubjectApi().then(res => {
      // console.log(res);
      this.setState({ subList: res.data })
      // console.log('subList',this.state.subList);
    })
  }
  render() {
    
    // let lname = this.state.subList[0].actionName
    return <div>
      
      <React.Fragment>
        {/* <Button>{this.state.subList[0].actionName}</Button> */}
        <Drawer anchor='left' open={true}>
          <ul>
            {this.state.subList.map(item => (
              <li className='fullList' key={item.id}>{item.title}</li>
            ))}
          </ul>
        </Drawer>
      </React.Fragment>
    </div>
  }
}  
